﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
   <meta charset="utf-8" />
  	  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dreamer Blog - 后台管理系统</title> 
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/resource/js/jQueryMessage/css/message.skin.css" />
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">编辑用户</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/admin/dashboard/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">编辑用户</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<form class="col s12" id="form1" enctype="multipart/form-data" th:action="@{/admin/user/update}" onsubmit="return validateForm();" method="post">
						<input type="hidden" th:value="${user.id}" id="id" name="id"/>
						<div class="form-group form-control-medium">
							<label for="username">用户名：</label>
							<input id="username" name="username" type="text" th:value="${user.username}" class="form-control" readonly="readonly"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="mobile">手机号：</label>
							<input id="mobile" name="mobile" type="text" th:value="${user.mobile}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="realname">真实姓名：</label>
							<input id="realname" name="realname" type="text" th:value="${user.realname}" class="form-control"/>
						</div>
						<div class="form-group form-control-medium">
							<label for="status">状态：</label>
							<input id="status-yes" name="status" type="radio" value="1" th:checked="${user.status} == 1"/> 有效
							<input id="status-no" name="status" type="radio" value="0" th:checked="${user.status} == 0"/> 无效
						</div>
						<div class="form-btn-group-left">
			            	<button type="submit" class="btn btn-info">保存</button>
			            </div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/resource/js/jQueryMessage/js/jquery.plugin.message.js"></script>
        <script type="text/javascript" th:inline="javascript">
	   	/* 保存方法 */
	    function validateForm(){
	    	var username = $("#username").val();
	    	if(username == null || username==''){
	    		$("body").MessageBox({
					type: 'error',
					message:'用户名不能为空！',
					timeout:3000,
					callbak:null
				});
	    		return false;
	    	}
	    	return true;
	    }
    </script>
</body>
</html>
